//
//  BoxCostHeadView.m
//  XLDoctor
//
//  Created by longma on 2018/10/8.
//  Copyright © 2018年 XLH. All rights reserved.
//

#import "MJUILoadingView.h"

@implementation MJUILoadingView

- (void)awakeFromNib{
    [super  awakeFromNib];
    
//    self.contentView.backgroundColor = UIColor.mj_appColor;
    
//    [self startAnimation];
    
    self.hidden = true;

}
- (void)layoutSubviews{
    [super layoutSubviews];
    
   
    
}


- (void)startAnimation{
    CABasicAnimation* rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];

    rotationAnimation.toValue = [NSNumber numberWithFloat: M_PI * 2.0 ];

    rotationAnimation.duration = 2;

    rotationAnimation.cumulative = YES;

    rotationAnimation.repeatCount = HUGE_VALF;

    [self.loadImageView.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"];
    self.hidden = false;

}

- (void)stopAnimation{
    [self.loadImageView.layer removeAllAnimations];
    self.hidden = true;
}

@end
